<?php echo $this->fetch('header.html'); ?>
<script type="text/javascript">
$(function(){
    $('#start_time').datepicker({dateFormat: 'yy-mm-dd'});
    $('#end_time').datepicker({dateFormat: 'yy-mm-dd'});
});
</script>
<div id="rightTop">
    <p>店铺优惠券</p>
    <ul class="subnav">
        <li><span>管理</span></li>
    </ul>
</div>
<div class="mrightTop">
    <div class="fontl">
        <form method="get">
            <div class="left">
                <input type="hidden" name="app" value="coupon" />
                <input type="hidden" name="act" value="index" />
                店铺名称:
                <input class="queryInput" type="text" name="store_name" value="<?php echo htmlspecialchars($_GET['store_name']); ?>" />
                开始时间:<input class="queryInput" type="text" value="<?php echo $this->_var['query']['start_time']; ?>" id="start_time" name="start_time" class="pick_date" />
                结束时间:<input class="queryInput" type="text" value="<?php echo $this->_var['query']['end_time']; ?>" id="end_time" name="end_time" class="pick_date" />
                <input type="submit" class="formbtn" value="查询" />
            </div>
            <?php if ($this->_var['filtered']): ?>
            <a class="left formbtn1" href="index.php?app=coupon<?php if ($_GET['wait_verify']): ?>&amp;wait_verify=<?php echo $_GET['wait_verify']; ?><?php endif; ?>">撤销检索</a>
            <?php endif; ?>
        </form>
    </div>
    <div class="fontr"><?php echo $this->fetch('page.top.html'); ?> </div>
</div>
<div class="tdare">
    <table width="100%" cellspacing="0" class="dataTable">
        <?php if ($this->_var['coupon_list']): ?>
        <tr class="tatr1">
            <td width="20" class="firstCell"><input type="checkbox" class="checkall" /></td>
            <td class="table-center">优惠券名称</td>
            <td class="table-center"><span ectype="order_by" fieldname="store_name">店铺名称</span></td>
            <td class="table-center"><span ectype="order_by" fieldname="coupon_value">优惠金额</span></td>
            <td class="table-center"><span ectype="order_by" fieldname="min_amount">使用条件</span></td>
            <td class="table-center"><span ectype="order_by" fieldname="if_issue">发布</span></td>
            <td class="table-center"><span ectype="order_by" fieldname="start_time">开始时间</span></td>
            <td class="table-center"><span ectype="order_by" fieldname="end_time">结束时间</span></td>
            <td class="table-center"><span ectype="order_by" fieldname="mall_recommended">商城推荐</span></td>
            <td class="handler">操作</td>
        </tr>
        <?php endif; ?>
        <?php $_from = $this->_var['coupon_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'coupon');if (count($_from)):
    foreach ($_from AS $this->_var['coupon']):
?>
        <tr class="tatr2">
            <td class="firstCell"><input type="checkbox" class="checkitem" value="<?php echo $this->_var['coupon']['coupon_id']; ?>" /></td>
            <td class="table-center"><?php echo htmlspecialchars($this->_var['coupon']['coupon_name']); ?></td>

            <td class="table-center"><?php echo htmlspecialchars($this->_var['coupon']['store_name']); ?></td>
            <td class="table-center"><?php echo htmlspecialchars($this->_var['coupon']['coupon_value']); ?></td>
            <td class="table-center"><?php echo htmlspecialchars($this->_var['coupon']['min_amount']); ?></td>
            <td class="table-center"><?php if ($this->_var['coupon']['if_issue'] | escape == '1'): ?>发布中<?php else: ?>未发布<?php endif; ?></td>
            <td class="table-center"><?php echo local_date("Y-m-d",$this->_var['coupon']['start_time']); ?></td>
            <td class="table-center"><?php echo local_date("Y-m-d",$this->_var['coupon']['end_time']); ?></td>
            <td class="table-center"><?php if ($this->_var['coupon']['mall_recommended']): ?><img src="templates/style/images/positive_enabled.gif" ectype="inline_edit" fieldname="mall_recommended" fieldid="<?php echo $this->_var['coupon']['coupon_id']; ?>" fieldvalue="1" title="单击可以编辑"/><?php else: ?><img src="templates/style/images/positive_disabled.gif" ectype="inline_edit" fieldname="mall_recommended" fieldid="<?php echo $this->_var['coupon']['coupon_id']; ?>" fieldvalue="0" title="单击可以编辑"/><?php endif; ?></td>
            <td class="handler">
                <a href="javascript:drop_confirm('您确定要删除它吗？', 'index.php?app=coupon&amp;act=drop&amp;id=<?php echo $this->_var['coupon']['coupon_id']; ?>');">删除</a>
                <a href="<?php echo $this->_var['site_url']; ?>/index.php?app=coupon&amp;act=view&amp;id=<?php echo $this->_var['coupon']['coupon_id']; ?>" target="_blank">查看</a>
            </td>
        </tr>
        <?php endforeach; else: ?>
        <tr class="no_data">
            <td colspan="12">没有符合条件的记录</td>
        </tr>
        <?php endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </table>
    <?php if ($this->_var['coupon_list']): ?>
    <div id="dataFuncs">
        <div class="pageLinks"><?php echo $this->fetch('page.bottom.html'); ?></div>
    </div>
    <div class="clear"></div>
    <?php endif; ?>

</div>
<?php echo $this->fetch('footer.html'); ?>